package config

import (
	"github.com/go-redis/redis/v8"
)
/**
* @Description:
* @Author: yuweizhu
* @Date: 2020/11/15 11:06 下午
**/
var (
	redisClient *redis.Client
	addr = "8.133.165.99:6379"
	//addr = "127.0.0.1:6379"
	password = ""
)

// 初始化redis
func InitRedisConfig() {
	redisClient = redis.NewClient(&redis.Options{
		Addr:     addr,
		Password: password,
		DB:       0,
	})
}

// 获取redis实例
func GetRedis() redis.Cmdable {
	return redisClient
}